Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support parameter prompting from command listeners #661

Merged
merged 1 commit into from
Jan 23, 2019

Conversation

cdupuis
Copy link
Member

@cdupuis cdupuis commented Jan 23, 2019

This enables to prompt for additional parameters during the execution of command listener functions.

See the following example:

    sdm.addCommand({
        name: "Hello",
        intent: "hello",
        parameters: { firstName: { type: "string", required: true } },
        listener: async ci => {
            const params = await ci.promptFor<{ lastName: string }>({ lastName: { required: true, type: "string" } });
            await ci.addressChannels(`${ci.parameters.firstName} ${params.lastName}`);
        },
    });

@cdupuis cdupuis added enhancement New feature or request changelog:added Add this issue or pull request to added changelog section auto-merge:on-approve Auto-merge on review approvals labels Jan 23, 2019
@cdupuis cdupuis requested a review from johnsonr January 23, 2019 14:49
@atomist-bot atomist-bot merged commit 251c3df into master Jan 23, 2019
@atomist-bot
Copy link
Contributor

Pull request auto merged by Atomist.

  • 1 approved review by @johnsonr
  • 2 successful checks

[atomist:generated] [auto-merge:on-approve]

@atomist-bot atomist-bot deleted the dyn-parameter branch January 23, 2019 19:20
atomist-bot added a commit that referenced this pull request Jan 23, 2019
[atomist:generated]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge:on-approve Auto-merge on review approvals changelog:added Add this issue or pull request to added changelog section enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants